struct ListNode* FindFirstCommonNode(struct ListNode* pHead1, struct ListNode* pHead2)
{
    int count1 = 0;
    int count2 = 0;
    struct ListNode* cur = pHead1;
    struct ListNode* pre = pHead2;
    while (cur != NULL)
    {
        count1++;
        cur = cur->next;
    }
    while (pre != NULL)
    {
        count2++;
        pre = pre->next;
    }
    int len = abs(count1 - count2);
    if (count1 >= count2)
    {
        while (len--)
        {
            pHead1 = pHead1->next;
        }
    }
    else
    {
        while (len--)
        {
            pHead2 = pHead2->next;
        }
    }
    while (pHead1 != pHead2)
    {
        pHead1 = pHead1->next;
        pHead2 = pHead2->next;
    }
    if (pHead1 && pHead2)
        return pHead1;
    else
        return NULL;
    // write code here
}